<template>
  <d2-container>
    <template slot="header"></template>

    <div class="inner">
      <ve-pie :data="chartData" :settings="chartSettings" v-bind="pubSetting"></ve-pie>
    </div>
  </d2-container>
</template>

<script>
import request from "@/plugin/axios";
import list from "@/views/demo/charts/list/_mixin/list.js";

export default {
  mixins: [list],
  name: "skuSellCountDetail",
  data() {
    this.chartEvents = {
      click: function(e) {
        console.log(e);
      }
    };
    this.chartSettings = {
      roseType: "radius"
    };
    return {
      value1: null,
      extend: {
        series: {
          label: { show: true, position: "top" }
        }
      },
      chartData: {
        columns: ["skuName", "sellCount"],
        rows: []
      }
    };
  },
  created() {
    let selectedDate = this.$route.query.selectedDate;
    this.$route.meta.title = selectedDate + ", 销量详情";

    request({
      url: "/statistics/skuSellCountDetail",
      method: "get",
      params: {
        startDate: selectedDate + " 00:00:00",
        endDate: selectedDate + " 23:59:59"
      }
    }).then(resp => {
      console.log(resp);
      this.chartData.rows = resp.data;
    });
  },
  methods: {
    
  }
};
</script>

<style lang="scss" scoped>
.inner {
  position: absolute;
  top: 20px;
  right: 20px;
  bottom: 20px;
  left: 20px;
}

.el-row {
  margin-bottom: 20px;
  &:last-child {
    margin-bottom: 0;
  }
}
</style>